import cv2
if __name__ == '__main__':
    # 1. 图片输入
    image_np = cv2.imread("C:\\Users\\20436\Desktop\daguniang.jpg")
    #2.切出需要滤波的范围
    roi = image_np.copy()[ :1171,199:]
    # 3. 滤波算法
    # 中值滤波
    no_noise_image = cv2.medianBlur(
        roi,  # 要滤波的图像
        13  # 核
    )
    #4.融合
    image_np[ :1171,199:]=no_noise_image
    # 5. 图片输出
    cv2.imshow('image_np',image_np)
    cv2.imwrite('image_np.jpg',image_np)
    cv2.waitKey(0)
